$(document).ready(function() {

    var offset = 0;
    plot();

    function plot() {
        var score = [],
        	myDate = new Date();
        for (var i = 1; i < 31; i += 1) {
        	myDate.setFullYear(2017,6,i);
        	score.push([i, Math.random()*100]);
        }

        var options = {
            series: {
                lines: {
                    show: true
                },
                points: {
                    show: true
                }
            },
            grid: {
                hoverable: true //IMPORTANT! this is needed for tooltip to work
            },
            yaxis: {
                min: 0,
                max: 100
            },
            xaxis: {
                tickSize: 1
            },
            tooltip: true,
            tooltipOpts: {
                content: "'%s' of %x is %y",
//                shifts: {
//                    x: -60,
//                    y: 25
//                }
            }
        };

        var plotObj = $.plot($("#flot-line-chart"), [{
                data: score,
                label: "score"
            }],
            options);
    }
});